package ioperation;

import Book.BookList;

import java.util.Scanner;

public class FindOperation implements IOPeration {
    @Override
    public void work(BookList bookList) {
        System.out.println("查找图书");
        int i = 0;
        System.out.println("请输入书名：");
        Scanner scanner = new Scanner(System.in);
        String name = scanner.nextLine();
        for (i = 0;i < bookList.getUsedSize(); i++){
            if(bookList.getBook(i).getName().equals(name)){
                System.out.println("找到了"+name);//✳✳✳✳
                return;
            }
        }
        System.out.println("没找到");
    }
}
